package com.kantboot.user.admin.web.admin.controller;

import com.kantboot.global.rest.result.CommonSuccessStateCodeAndMsg;
import com.kantboot.user.admin.domain.entity.UserAdminRouter;
import com.kantboot.user.admin.service.IUserAdminRouterService;
import com.kantboot.util.common.result.RestResult;
import com.kantboot.util.core.controller.BaseAdminController;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user-admin-web/admin/router")
public class UserAdminRouterControllerOfAdmin extends BaseAdminController<UserAdminRouter, Long> {

    @Resource
    private IUserAdminRouterService service;

    /**
     * 获取所有路由
     * @return 所有路由
     */
    @RequestMapping("/getList")
    public RestResult<Object> getList() {
        return RestResult.success(service.getList(), CommonSuccessStateCodeAndMsg.GET_SUCCESS);
    }

    /**
     * 获取自己的路由
     */
    @RequestMapping("/getSelf")
    public RestResult<Object> getSelf() {
        return RestResult.success(service.getSelf(), CommonSuccessStateCodeAndMsg.GET_SUCCESS);
    }


}
